home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.Dimension;
- import java.awt.Rectangle;
- import java.awt.event.ActionEvent;
- import javax.swing.AbstractAction;
- import javax.swing.tree.TreePath;
-
- public class BasicTreeUI$TreePageAction extends AbstractAction {
- // $FF: synthetic field
- private final BasicTreeUI this$0;
- protected int direction;
- private boolean addToSelection;
- private boolean changeSelection;
-
- public BasicTreeUI$TreePageAction(BasicTreeUI var1, int var2, String var3) {
- this(var1, var2, var3, false, true);
- }
-
- private BasicTreeUI$TreePageAction(BasicTreeUI var1, int var2, String var3, boolean var4, boolean var5) {
- this.this$0 = var1;
- this.direction = var2;
- this.addToSelection = var4;
- this.changeSelection = var5;
- }
-
- // $FF: synthetic method
- BasicTreeUI$TreePageAction(BasicTreeUI var1, BasicTreeUI.1 var2, int var3, String var4, boolean var5, boolean var6) {
- this(var1, var3, var4, var5, var6);
- }
-
- public void actionPerformed(ActionEvent var1) {
- if (this.this$0.tree != null && this.this$0.getRowCount(this.this$0.tree) > 0 && this.this$0.treeSelectionModel != null) {
- Dimension var3 = this.this$0.tree.getSize();
- TreePath var4 = BasicTreeUI.access$4(this.this$0);
- Rectangle var6 = this.this$0.tree.getVisibleRect();
- TreePath var5;
- if (this.direction == -1) {
- var5 = this.this$0.getClosestPathForLocation(this.this$0.tree, var6.x, var6.y);
- if (var5.equals(var4)) {
- var6.y = Math.max(0, var6.y - var6.height);
- var5 = this.this$0.tree.getClosestPathForLocation(var6.x, var6.y);
- }
- } else {
- var6.y = Math.min(var3.height, var6.y + var6.height - 1);
- var5 = this.this$0.tree.getClosestPathForLocation(var6.x, var6.y);
- if (var5.equals(var4)) {
- var6.y = Math.min(var3.height, var6.y + var6.height - 1);
- var5 = this.this$0.tree.getClosestPathForLocation(var6.x, var6.y);
- }
- }
-
- Rectangle var7 = this.this$0.getPathBounds(this.this$0.tree, var5);
- var7.x = var6.x;
- var7.width = var6.width;
- if (this.direction == -1) {
- var7.height = var6.height;
- } else {
- var7.y -= var6.height - var7.height;
- var7.height = var6.height;
- }
-
- if (this.addToSelection) {
- BasicTreeUI.access$7(this.this$0, var5);
- } else if (this.changeSelection) {
- this.this$0.tree.setSelectionPath(var5);
- } else {
- BasicTreeUI.access$6(this.this$0, var5, true);
- }
-
- this.this$0.tree.scrollRectToVisible(var7);
- }
-
- }
-
- public boolean isEnabled() {
- return this.this$0.tree != null && this.this$0.tree.isEnabled();
- }
- }
-